/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author PARINYA
 */
@Entity
@Table(name = "m_hospital")
@NamedQueries({
    @NamedQuery(name = "MHospital.findAll", query = "SELECT m FROM MHospital m"),
    @NamedQuery(name = "MHospital.findById", query = "SELECT m FROM MHospital m WHERE m.id = :id"),
    @NamedQuery(name = "MHospital.findByName", query = "SELECT m FROM MHospital m WHERE m.name = :name"),
    @NamedQuery(name = "MHospital.findByHospitalLevel", query = "SELECT m FROM MHospital m WHERE m.hospitalLevel = :hospitalLevel"),
    @NamedQuery(name = "MHospital.findByLatitude", query = "SELECT m FROM MHospital m WHERE m.latitude = :latitude"),
    @NamedQuery(name = "MHospital.findByLongtitude", query = "SELECT m FROM MHospital m WHERE m.longtitude = :longtitude")})
public class MHospital implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Long id;
    @Basic(optional = false)
    @Column(name = "Name")
    private String name;
    @Lob
    @Column(name = "Location")
    private String location;
    @Column(name = "HospitalLevel")
    private String hospitalLevel;
    @Column(name = "Latitude")
    private BigDecimal latitude;
    @Column(name = "Longtitude")
    private BigDecimal longtitude;
    @OneToMany(mappedBy = "mHospital")
    private Collection<SrvCureservice> srvCureserviceCollection;

    public MHospital() {
    }

    public MHospital(Long id) {
        this.id = id;
    }

    public MHospital(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getHospitalLevel() {
        return hospitalLevel;
    }

    public void setHospitalLevel(String hospitalLevel) {
        this.hospitalLevel = hospitalLevel;
    }

    public BigDecimal getLatitude() {
        return latitude;
    }

    public void setLatitude(BigDecimal latitude) {
        this.latitude = latitude;
    }

    public BigDecimal getLongtitude() {
        return longtitude;
    }

    public void setLongtitude(BigDecimal longtitude) {
        this.longtitude = longtitude;
    }

    public Collection<SrvCureservice> getSrvCureserviceCollection() {
        return srvCureserviceCollection;
    }

    public void setSrvCureserviceCollection(Collection<SrvCureservice> srvCureserviceCollection) {
        this.srvCureserviceCollection = srvCureserviceCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MHospital)) {
            return false;
        }
        MHospital other = (MHospital) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.MHospital[id=" + id + "]";
    }

}
